package com.yawn.zddefect.controller;

import com.yawn.zddefect.service.CountService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/count")
public class ProDefectsCountController {

    @Resource
    private CountService countService;

    @GetMapping("/rank{rank}")
    public int rankCount(@PathVariable("rank") int rank, String proCode) {
        return countService.rankCount(rank, proCode);
    }

    @GetMapping("/resolve")
    public int rankCount(boolean resolved, String proCode) {
        return countService.resolveCount(resolved, proCode);
    }
}
